import { request } from '@/utils'

export default {
    login: (data) => request.post('/system/base/access_token', data, { noNeedToken: true }),
    getHome: () => request.get('/system/base/home'),
    getUserInfo: () => request.get('/system/base/userinfo'),
    getUserMenu: () => request.get('/system/base/usermenu'),
    getUserApi: () => request.get('/system/base/userapi'),
    // profile
    updatePassword: (data = {}) => request.post('/system/base/update_password', data),
    // users
    getUserList: (params = {}) => request.get('/system/users/list', { params }),
    getUserById: (params = {}) => request.get('/system/users/get', { params }),
    createUser: (data = {}) => request.post('/system/users/create', data),
    updateUser: (data = {}) => request.post('/system/users/update', data),
    deleteUser: (params = {}) => request.delete(`/system/users/delete`, { params }),
    getUsers: (params = {}) => request.get('/system/users/users', { params }),
    // role
    getRoleList: (params = {}) => request.get('/system/role/list', { params }),
    createRole: (data = {}) => request.post('/system/role/create', data),
    updateRole: (data = {}) => request.post('/system/role/update', data),
    deleteRole: (params = {}) => request.delete('/system/role/delete', { params }),
    updateRoleAuthorized: (data = {}) => request.post('/system/role/authorized', data),
    getRoleAuthorized: (params = {}) => request.get('/system/role/authorized', { params }),
    // menus
    getMenus: (params = {}) => request.get('/system/menu/list', { params }),
    createMenu: (data = {}) => request.post('/system/menu/create', data),
    updateMenu: (data = {}) => request.post('/system/menu/update', data),
    deleteMenu: (params = {}) => request.delete('/system/menu/delete', { params }),
    // apis
    getApis: (params = {}) => request.get('/system/api/list', { params }),
    createApi: (data = {}) => request.post('/system/api/create', data),
    updateApi: (data = {}) => request.post('/system/api/update', data),
    deleteApi: (params = {}) => request.delete('/system/api/delete', { params }),
    refreshApi: (data = {}) => request.post('/system/api/refresh', data),
    // depts
    getDepts: (params = {}) => request.get('/system/dept/list', { params }),
    createDept: (data = {}) => request.post('/system/dept/create', data),
    updateDept: (data = {}) => request.post('/system/dept/update', data),
    deleteDept: (params = {}) => request.delete('/system/dept/delete', { params }),
    getDeptsTree: (params = {}) => request.get('/system/dept/tree', { params }),
    // auditlog
    getAuditLogList: (params = {}) => request.get('/system/auditlog/list', { params }),
    getAuditMyLogList: (params = {}) => request.get('/system/auditlog/mylist', { params }),
    // notice
    getNoticeList: (params = {}) => request.get('/system/notices/list', { params }),
    updateNotice: (data = {}) => request.post('/system/notices/update', data),
    createNotice: (data = {}) => request.post('/system/notices/create', data),
    deleteNotice: (params = {}) => request.delete('/system/notices/delete', { params }),
    // downloads
    createDownloadsList: (data = {}) => request.post('/system/downloads/create', data),
    createDownexcelList: (data = {}) => request.post('/system/downloads/create_excel', data),
    getDownloadsList: (params = {}) => request.get('/system/downloads/list', { params }),
    getDownloadsListExcel: (params = {}) => request.get('/system/downloads/list_excel', { params }),
    onDownload: (params = {}) => request.get('/system/downloads/down', { params }),
    getFiles: (params = {}) => request.get('/system/downloads/files', { params }),
    deleteFiles: (params = {}) => request.get('/system/downloads/delete_file', { params }),
    downloadFiles: (params = {}) => request.get('/system/downloads/download_file', { params }),
    // jobs
    getJobsRule: (params = {}) => request.get('/jobs/jobs_rule/list', { params }),
    createJobsRule: (data = {}) => request.post('/jobs/jobs_rule/create', data),
    updateJobsRule: (data = {}) => request.post('/jobs/jobs_rule/update', data),
    deleteJobsRule: (params = {}) => request.delete('/jobs/jobs_rule/delete', { params }),
    getJobsRuleType: (params = {}) => request.get('/jobs/jobs_rule/type', { params }),
    getJobsLog: (params = {}) => request.get('/jobs/jobs_log/list', { params }),
    createJobsLog: (data = {}) => request.post('/jobs/jobs_log/create', data),
    updateJobsLog: (data = {}) => request.post('/jobs/jobs_log/update', data),
    deleteJobsLog: (params = {}) => request.delete('/jobs/jobs_log/delete', { params }),
    getJobsRuleList: (params = {}) => request.get('/jobs/jobs_log/jobs_rule', { params }),

    //customers
    getCustomers: (params = {}) => request.get('/customers/customers_list/list', { params }),
    createCustomers: (data = {}) => request.post('/customers/customers_list/create', data),
    updateCustomers: (data = {}) => request.post('/customers/customers_list/update', data),
    deleteCustomers: (params = {}) => request.delete('/customers/customers_list/delete', { params }),
    getListLevel: (params = {}) => request.get('/customers/customers_list/list_level', { params }),
    getStatusLevel: (params = {}) => request.get('/customers/customers_list/status_level', { params }),

    getCustomersFollow: (params = {}) => request.get('/customers/customers_follow/list', { params }),
    createCustomersFollow: (data = {}) => request.post('/customers/customers_follow/create', data),
    updateCustomersFollow: (data = {}) => request.post('/customers/customers_follow/update', data),
    deleteCustomersFollow: (params = {}) => request.delete('/customers/customers_follow/delete', { params }),

    getAnswers: (params = {}) => request.get('/answers/answer_list/list', { params }),
    createAnswers: (data = {}) => request.post('/answers/answer_list/create', data),
    updateAnswers: (data = {}) => request.post('/answers/answer_list/update', data),
    deleteAnswers: (params = {}) => request.delete('/answers/answer_list/delete', { params }),

    createCustomersByUser: (data = {}) => request.post('/customers/customers_post/create_user', data),
    createCustomersFollowUser: (data = {}) => request.post('/customers/customers_post/create_f', data),

}


